export default app => {
  const { STRING, INTEGER, DATE } = app.Sequelize;

  const position = app.model.define('position', {
    id: { type: INTEGER, primaryKey: true, autoIncrement: true },
    uuid: { type: STRING(36), unique: true },
    name: STRING(10), // 职务名
    createdAt: DATE,
    updatedAt: DATE,
  });

  position.associate = () => {
    app.model.Position.hasMany(app.model.Talent, {
      foreignKey: 'post',
      sourceKey: 'uuid',
    });
  };
  return position;
};
